package com.tencent.wxcloudrun.service;

import com.tencent.wxcloudrun.model.Admin;
import com.tencent.wxcloudrun.repository.AdminRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class AdminService {

    @Autowired
    private AdminRepository adminRepository;

    // 根据用户名查找管理员
    public Optional<Admin> findByUsername(String username) {
        return adminRepository.findByUsername(username);
    }

}
